var next = document.querySelector('.partner-content-next');
var prev = document.querySelector('.partner-content-prev');
var children = document.querySelector('.partner .swiper-wrapper').children;
next.style.display = 'none';

var swiper = new Swiper('.partner .swiper-container',{
    autoplay : 5000,//可选选项，自动滑动
    // loop : true,//可选选项，开启循环
    queueEndCallbacks : true,
    queueStartCallbacks : true,
    onSlideChangeEnd: changeEndHandle,
    simulateTouch: true
});

function changeEndHandle (swiper) {
    if ((swiper.activeIndex+1) === children.length) {
        prev.style.display = 'none';
    } else {
        prev.style.display = 'block';
    }

    if (swiper.activeIndex === 0) {
        next.style.display = 'none';
    } else {
        next.style.display = 'block';
    }
    
}

prev.addEventListener('click', function (event) {
    event.preventDefault();
    swiper.swipeNext();
    // alert(swiper.activeIndex)
}, false);

next.addEventListener('click', function (event) {
    event.preventDefault();
    swiper.swipePrev();
}, false);